package com.flybear.aqi.cmdprocess;

import com.google.common.collect.Maps;
import io.netty.channel.Channel;

import java.util.Map;
import java.util.Set;

public class ChannelService {

    public static final Map<String,Channel> channels= Maps.newConcurrentMap();//clientip<>channel
//    public static final Map<String,Channel> deviceidchannels= Maps.newConcurrentMap();//deviceid<>channel
//    public static final Map<String,String> deviceidclientips= Maps.newConcurrentMap();//deviceid<>clientip
    public static final Map<String,String> clientipsdeviceid= Maps.newConcurrentMap();//clientip<>deviceid
    public void sendCmdToDeviceByMN(String clientip,String msg){
            Channel c=  channels.get(clientip);
           if(c!=null) c.writeAndFlush(msg);

    }

}
